//
//  XGCalendar.h
//  SACalendar
//
//  Created by YaoZhaofeng on 15/4/16.
//  Copyright (c) 2015年 SyncoApp. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "XGCalendarConstants.h"
#import "XGCalendarDelegate.h"
#import "XGCalendarDataSource.h"
#import "NSCalendarCategories.h"

typedef enum {
    XGCalendarViewModeMonth = 0,
    XGCalendarViewModeWeek = 1,
} XGCalendarDisplayMode;

@interface XGCalendar : UIView
@property (nonatomic, assign) id<XGCalendarDelegate> delegate;
@property (nonatomic, assign) id<XGCalendarDataSource> dataSource;


@property(nonatomic, copy)   NSCalendar     *calendar;          // default is [NSCalendar currentCalendar]. setting nil returns to default
@property (nonatomic, strong) NSDate *date;
@property (nonatomic, assign) XGCalendarDisplayMode displayMode;

/**
 *  Default constructor. Calendar will begin at current month
 *
 *  @param frame of the calendar
 *
 *  @return initialized calendar
 */
- (id)initWithFrame:(CGRect)frame;

/**
 *  Begin calendar at specific month and year
 *
 *  @param frame of the calendar
 *  @param m     month to begin calendar
 *  @param y     year to begin calendar
 *
 *  @return initialized calendar starting at mm/yyyy
 */
- (id)initWithFrame:(CGRect)frame month:(int)m year:(int)y;

/**
 *  Calendar will begin at current month. The user can also specify other properties
 *
 *  @param frame     of the calendar
 *  @param direction scroll direction, default to horizontal
 *  @param paging    paging enabled, default to yes
 *
 *  @return initialized calendar
 */
-(id)initWithFrame:(CGRect)frame
   scrollDirection:(scrollDirection)direction
     pagingEnabled:(BOOL)paging;

/**
 *  The complete constructor
 *
 *  @param frame     of the calendar
 *  @param m         month to begin calendar
 *  @param y         year to begin calendar
 *  @param direction scroll direction, default to horizontal
 *  @param paging    paging enabled, default to yes
 *
 *  @return initialized calendar
 */
-(id)initWithFrame:(CGRect)frame
             month:(int)m year:(int)y
   scrollDirection:(scrollDirection)direction
     pagingEnabled:(BOOL)paging;
@end
